#include "Skeleton.h"

Skeleton::Skeleton(Vector2D position)
{
	this->position = position;
	head = new Bone(NULL, 0, 1, new TextureBox()); 
}
Skeleton::Skeleton(Vector2D position, Bone * head)
{
	printf("making skeleton\n");
	this->position = position;
	this->head = head;	
	printf("done making skeleton\n");
}
Skeleton::~Skeleton()
{
	if(head)
	{
		delete(head);
		head = NULL;
	}
}	
void Skeleton::Draw()
{
	if(head)
	{
		glPushMatrix();
		glLoadIdentity();
		glTranslatef(position.x,position.y, 0.0);
		head->Draw();
		glPopMatrix();
	}
}
Bone * Skeleton::Click(Mouse * mouse)
{
	if(head)
		return head->Click(position, mouse);
	return NULL;
}
Vector2D Skeleton::GetHeadPosition()
{
	return position;
}
char * Skeleton::GetTag()
{
	return head->GetTag();
}
char * Skeleton::GetPose()
{
	return head->GetPose();
}
void Skeleton::ToggleDisplay()
{
	head->ToggleDisplay();
}
void Skeleton::ToggleLock()
{
	head->ToggleLock();
}

